package edu.sandau.b230151.b23015122.repository;

import edu.sandau.b230151.b23015122.Model.Book;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface BookRepository extends JpaRepository<Book, Integer> {
    List<Book> findByTitle(String title);

    List<Book> findByTitleAndId(String title, int id);

    List<Book> findByTitleOrId(String title, int id);
    List<Book> findById(int  id);

    @Query(nativeQuery = true,value = "select * from book where title = ?1")
    List<Book> findByNativeQuery(String title);

}
